<?php
//页面字符规定
header("Content-type: text/html; charset=utf-8");
//打开session
session_start ();
//导入页面
include 'functions.php';

//页面头部
echo <<<end
<html>
<head>
	<title>找回密码</title>
	<meta charset = "utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
	<link href="css/login.css" rel="stylesheet" type="text/css" />

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
	
</head>
<body>

end;


//接收数据判断
	
	if (isset($_GET["gongsi"]))
	{
		$gongsi = $_GET["gongsi"];
		//echo $gongsi;
	}
	else
	{
		
	//页面显示内容	
		echo <<<end1
		
	<div class="container">
		<form action="wangjimima.php" class="form-signin">
		 <h2 class="form-signin-heading">找回密码</h2>
		请输入您所在的公司：
		<input type="text" name="gongsi" class="input-block-level" placeholder="请输入公司">
		<br>
		<input type="submit" value="确定" class="btn">
		<a class="btn" href='index.php'>返 回</a>
		</form>
	</div>

end1;
		
		$gongsi = "";
	}
	
	if ($gongsi == "" || $gongsi == null)
	{
		echo "<script>"."alert('公司不能为空!')"."</script>";
	}
	else
	{
	//查询	
		mysql_query("set names 'utf8'");
		$querytelsql="SELECT
					a00user.uname,
					a00user.movephoto
					FROM
					a00user
					INNER JOIN company ON a00user.company = company.company where company.company =\"$gongsi\" and a00user.ugb=-1";
		$querytelsql1=mysql_query($querytelsql);
   		
	//输入成功显示的内容
		echo <<<end2
		
		<div class="container">
		<div class="form-signin">
		以下是您公司的管理员电话，如要修改密码请自主联系
		<br>
		<br>
end2;
		while ($querytelsql2=mysql_fetch_row($querytelsql1))
		{
			echo "<a href='tel:$querytelsql2[1]'>$querytelsql2[0]</a><br>";
			echo "<a href='tel:$querytelsql2[1]'>$querytelsql2[1]</a><br>";
		}
		
		
		echo "<a href='index.php'>返回首页</>";
		echo "</div></div>";
		


	}
	
	



include 'bottom.php';
?>